﻿/*
sp_GenerateClass
	@namespace			= 'NormalTests.AdventureWorks', 
	@column_has_prefix	= 0
 */
using System;
using Normal;
using System.Collections.Generic;

namespace NormalTests.AdventureWorks
{
    [Serializable]
    [Table(TableName = "dbo.AWBuildVersion")]
    public class Awbuildversion : MarshalByRefObject
    {
        private Int16 _systeminformationid;
        private string _databaseversion;
        private DateTime _versiondate;
        private DateTime _modifieddate;

        [Id(Name = "SystemInformationID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int16 Systeminformationid
        {
            get { return _systeminformationid; }
            set { _systeminformationid = value; }
        }

        [Column(Name = "Database Version", Required = true)]
        public string Databaseversion
        {
            get { return _databaseversion; }
            set { _databaseversion = value; }
        }

        [Column(Name = "VersionDate", Required = true)]
        public DateTime Versiondate
        {
            get { return _versiondate; }
            set { _versiondate = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "dbo.DatabaseLog")]
    public class Databaselog : MarshalByRefObject
    {
        private Int32 _databaselogid;
        private DateTime _posttime;
        private string _databaseuser;
        private string _event;
        private string _schema;
        private string _object;
        private string _tsql;
        private string _xmlevent;

        [Id(Name = "DatabaseLogID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Databaselogid
        {
            get { return _databaselogid; }
            set { _databaselogid = value; }
        }

        [Column(Name = "PostTime", Required = true)]
        public DateTime Posttime
        {
            get { return _posttime; }
            set { _posttime = value; }
        }

        [Column(Name = "DatabaseUser", Required = true)]
        public string Databaseuser
        {
            get { return _databaseuser; }
            set { _databaseuser = value; }
        }

        [Column(Name = "Event", Required = true)]
        public string Event
        {
            get { return _event; }
            set { _event = value; }
        }

        [Column(Name = "Schema", Required = false)]
        public string Schema
        {
            get { return _schema; }
            set { _schema = value; }
        }

        [Column(Name = "Object", Required = false)]
        public string Object
        {
            get { return _object; }
            set { _object = value; }
        }

        [Column(Name = "TSQL", Required = true)]
        public string Tsql
        {
            get { return _tsql; }
            set { _tsql = value; }
        }

        [Column(Name = "XmlEvent", Required = true)]
        public string Xmlevent
        {
            get { return _xmlevent; }
            set { _xmlevent = value; }
        }

    }
    [Serializable]
    [Table(TableName = "dbo.ErrorLog")]
    public class Errorlog : MarshalByRefObject
    {
        private Int32 _errorlogid;
        private DateTime _errortime;
        private string _username;
        private Int32 _errornumber;
        private Int32? _errorseverity;
        private Int32? _errorstate;
        private string _errorprocedure;
        private Int32? _errorline;
        private string _errormessage;

        [Id(Name = "ErrorLogID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Errorlogid
        {
            get { return _errorlogid; }
            set { _errorlogid = value; }
        }

        [Column(Name = "ErrorTime", Required = true)]
        public DateTime Errortime
        {
            get { return _errortime; }
            set { _errortime = value; }
        }

        [Column(Name = "UserName", Required = true)]
        public string Username
        {
            get { return _username; }
            set { _username = value; }
        }

        [Column(Name = "ErrorNumber", Required = true)]
        public Int32 Errornumber
        {
            get { return _errornumber; }
            set { _errornumber = value; }
        }

        [Column(Name = "ErrorSeverity", Required = false)]
        public Int32? Errorseverity
        {
            get { return _errorseverity; }
            set { _errorseverity = value; }
        }

        [Column(Name = "ErrorState", Required = false)]
        public Int32? Errorstate
        {
            get { return _errorstate; }
            set { _errorstate = value; }
        }

        [Column(Name = "ErrorProcedure", Required = false)]
        public string Errorprocedure
        {
            get { return _errorprocedure; }
            set { _errorprocedure = value; }
        }

        [Column(Name = "ErrorLine", Required = false)]
        public Int32? Errorline
        {
            get { return _errorline; }
            set { _errorline = value; }
        }

        [Column(Name = "ErrorMessage", Required = true)]
        public string Errormessage
        {
            get { return _errormessage; }
            set { _errormessage = value; }
        }

    }
    [Serializable]
    [Table(TableName = "dbo.sequence")]
    public class Sequence : MarshalByRefObject
    {
        private string _name;
        private Int32? _id;

        [Column(Name = "name", Required = false)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "id", Required = false)]
        public Int32? Id
        {
            get { return _id; }
            set { _id = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.Department")]
    public class Department : MarshalByRefObject
    {
        private Int16 _departmentid;
        private string _name;
        private string _groupname;
        private DateTime _modifieddate;
        private List<Employeedepartmenthistory> _employeedepartmenthistorys;

        [Id(Name = "DepartmentID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int16 Departmentid
        {
            get { return _departmentid; }
            set { _departmentid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "GroupName", Required = true)]
        public string Groupname
        {
            get { return _groupname; }
            set { _groupname = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Employeedepartmenthistory> Employeedepartmenthistorys
        {
            get { return _employeedepartmenthistorys; }
            set { _employeedepartmenthistorys = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.Employee")]
    public class Employee : MarshalByRefObject
    {
        private Int32 _employeeid;
        private string _nationalidnumber;
        private Contact _contactid;
        private string _loginid;
        private Employee _managerid;
        private string _title;
        private DateTime _birthdate;
        private string _maritalstatus;
        private string _gender;
        private DateTime _hiredate;
        private bool _salariedflag;
        private Int16 _vacationhours;
        private Int16 _sickleavehours;
        private bool _currentflag;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Employeeaddress> _employeeaddresss;
        private List<Employeedepartmenthistory> _employeedepartmenthistorys;
        private List<Employeepayhistory> _employeepayhistorys;
        private List<Purchaseorderheader> _purchaseorderheaders;
        private List<Salesperson> _salespersons;

        [Id(Name = "EmployeeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Column(Name = "NationalIDNumber", Required = true)]
        public string Nationalidnumber
        {
            get { return _nationalidnumber; }
            set { _nationalidnumber = value; }
        }

        [Column(Name = "ContactID", Required = true)]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "LoginID", Required = true)]
        public string Loginid
        {
            get { return _loginid; }
            set { _loginid = value; }
        }

        [Column(Name = "ManagerID", Required = false)]
        public Employee Managerid
        {
            get { return _managerid; }
            set { _managerid = value; }
        }

        [Column(Name = "Title", Required = true)]
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        [Column(Name = "BirthDate", Required = true)]
        public DateTime Birthdate
        {
            get { return _birthdate; }
            set { _birthdate = value; }
        }

        [Column(Name = "MaritalStatus", Required = true)]
        public string Maritalstatus
        {
            get { return _maritalstatus; }
            set { _maritalstatus = value; }
        }

        [Column(Name = "Gender", Required = true)]
        public string Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }

        [Column(Name = "HireDate", Required = true)]
        public DateTime Hiredate
        {
            get { return _hiredate; }
            set { _hiredate = value; }
        }

        [Column(Name = "SalariedFlag", Required = true)]
        public bool Salariedflag
        {
            get { return _salariedflag; }
            set { _salariedflag = value; }
        }

        [Column(Name = "VacationHours", Required = true)]
        public Int16 Vacationhours
        {
            get { return _vacationhours; }
            set { _vacationhours = value; }
        }

        [Column(Name = "SickLeaveHours", Required = true)]
        public Int16 Sickleavehours
        {
            get { return _sickleavehours; }
            set { _sickleavehours = value; }
        }

        [Column(Name = "CurrentFlag", Required = true)]
        public bool Currentflag
        {
            get { return _currentflag; }
            set { _currentflag = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Employeeaddress> Employeeaddresss
        {
            get { return _employeeaddresss; }
            set { _employeeaddresss = value; }
        }

        public List<Employeedepartmenthistory> Employeedepartmenthistorys
        {
            get { return _employeedepartmenthistorys; }
            set { _employeedepartmenthistorys = value; }
        }

        public List<Employeepayhistory> Employeepayhistorys
        {
            get { return _employeepayhistorys; }
            set { _employeepayhistorys = value; }
        }

        public List<Purchaseorderheader> Purchaseorderheaders
        {
            get { return _purchaseorderheaders; }
            set { _purchaseorderheaders = value; }
        }

        public List<Salesperson> Salespersons
        {
            get { return _salespersons; }
            set { _salespersons = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.EmployeeAddress")]
    public class Employeeaddress : MarshalByRefObject
    {
        private Employee _employeeid;
        private Address _addressid;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "EmployeeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Employee Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Id(Name = "AddressID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Address Addressid
        {
            get { return _addressid; }
            set { _addressid = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.EmployeeDepartmentHistory")]
    public class Employeedepartmenthistory : MarshalByRefObject
    {
        private Employee _employeeid;
        private Department _departmentid;
        private Shift _shiftid;
        private DateTime _startdate;
        private DateTime? _enddate;
        private DateTime _modifieddate;

        [Id(Name = "EmployeeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Employee Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Id(Name = "DepartmentID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Department Departmentid
        {
            get { return _departmentid; }
            set { _departmentid = value; }
        }

        [Id(Name = "ShiftID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Shift Shiftid
        {
            get { return _shiftid; }
            set { _shiftid = value; }
        }

        [Id(Name = "StartDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.EmployeePayHistory")]
    public class Employeepayhistory : MarshalByRefObject
    {
        private Employee _employeeid;
        private DateTime _ratechangedate;
        private decimal _rate;
        private Int16 _payfrequency;
        private DateTime _modifieddate;

        [Id(Name = "EmployeeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Employee Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Id(Name = "RateChangeDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Ratechangedate
        {
            get { return _ratechangedate; }
            set { _ratechangedate = value; }
        }

        [Column(Name = "Rate", Required = true)]
        public decimal Rate
        {
            get { return _rate; }
            set { _rate = value; }
        }

        [Column(Name = "PayFrequency", Required = true)]
        public Int16 Payfrequency
        {
            get { return _payfrequency; }
            set { _payfrequency = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.JobCandidate")]
    public class Jobcandidate : MarshalByRefObject
    {
        private Int32 _jobcandidateid;
        private Employee _employeeid;
        private string _resume;
        private DateTime _modifieddate;

        [Id(Name = "JobCandidateID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Jobcandidateid
        {
            get { return _jobcandidateid; }
            set { _jobcandidateid = value; }
        }

        [Column(Name = "EmployeeID", Required = false)]
        public Employee Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Column(Name = "Resume", Required = false)]
        public string Resume
        {
            get { return _resume; }
            set { _resume = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "HumanResources.Shift")]
    public class Shift : MarshalByRefObject
    {
        private Int16 _shiftid;
        private string _name;
        private DateTime _starttime;
        private DateTime _endtime;
        private DateTime _modifieddate;
        private List<Employeedepartmenthistory> _employeedepartmenthistorys;

        [Id(Name = "ShiftID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int16 Shiftid
        {
            get { return _shiftid; }
            set { _shiftid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "StartTime", Required = true)]
        public DateTime Starttime
        {
            get { return _starttime; }
            set { _starttime = value; }
        }

        [Column(Name = "EndTime", Required = true)]
        public DateTime Endtime
        {
            get { return _endtime; }
            set { _endtime = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Employeedepartmenthistory> Employeedepartmenthistorys
        {
            get { return _employeedepartmenthistorys; }
            set { _employeedepartmenthistorys = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.Address")]
    public class Address : MarshalByRefObject
    {
        private Int32 _addressid;
        private string _addressline1;
        private string _addressline2;
        private string _city;
        private Stateprovince _stateprovinceid;
        private string _postalcode;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Customeraddress> _customeraddresss;
        private List<Employeeaddress> _employeeaddresss;
        private List<Salesorderheader> _salesorderheaders;
        private List<Vendoraddress> _vendoraddresss;

        [Id(Name = "AddressID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Addressid
        {
            get { return _addressid; }
            set { _addressid = value; }
        }

        [Column(Name = "AddressLine1", Required = true)]
        public string Addressline1
        {
            get { return _addressline1; }
            set { _addressline1 = value; }
        }

        [Column(Name = "AddressLine2", Required = false)]
        public string Addressline2
        {
            get { return _addressline2; }
            set { _addressline2 = value; }
        }

        [Column(Name = "City", Required = true)]
        public string City
        {
            get { return _city; }
            set { _city = value; }
        }

        [Column(Name = "StateProvinceID", Required = true)]
        public Stateprovince Stateprovinceid
        {
            get { return _stateprovinceid; }
            set { _stateprovinceid = value; }
        }

        [Column(Name = "PostalCode", Required = true)]
        public string Postalcode
        {
            get { return _postalcode; }
            set { _postalcode = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Customeraddress> Customeraddresss
        {
            get { return _customeraddresss; }
            set { _customeraddresss = value; }
        }

        public List<Employeeaddress> Employeeaddresss
        {
            get { return _employeeaddresss; }
            set { _employeeaddresss = value; }
        }

        public List<Salesorderheader> Salesorderheaders
        {
            get { return _salesorderheaders; }
            set { _salesorderheaders = value; }
        }

        public List<Vendoraddress> Vendoraddresss
        {
            get { return _vendoraddresss; }
            set { _vendoraddresss = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.AddressType")]
    public class Addresstype : MarshalByRefObject
    {
        private Int32 _addresstypeid;
        private string _name;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Customeraddress> _customeraddresss;
        private List<Vendoraddress> _vendoraddresss;

        [Id(Name = "AddressTypeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Addresstypeid
        {
            get { return _addresstypeid; }
            set { _addresstypeid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Customeraddress> Customeraddresss
        {
            get { return _customeraddresss; }
            set { _customeraddresss = value; }
        }

        public List<Vendoraddress> Vendoraddresss
        {
            get { return _vendoraddresss; }
            set { _vendoraddresss = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.Contact")]
    public class Contact : MarshalByRefObject
    {
        private Int32 _contactid;
        private bool _namestyle;
        private string _title;
        private string _firstname;
        private string _middlename;
        private string _lastname;
        private string _suffix;
        private string _emailaddress;
        private Int32 _emailpromotion;
        private string _phone;
        private string _passwordhash;
        private string _passwordsalt;
        private string _additionalcontactinfo;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Contactcreditcard> _contactcreditcards;
        private List<Employee> _employees;
        private List<Individual> _individuals;
        private List<Salesorderheader> _salesorderheaders;
        private List<Storecontact> _storecontacts;
        private List<Vendorcontact> _vendorcontacts;

        [Id(Name = "ContactID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "NameStyle", Required = true)]
        public bool Namestyle
        {
            get { return _namestyle; }
            set { _namestyle = value; }
        }

        [Column(Name = "Title", Required = false)]
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        [Column(Name = "FirstName", Required = true)]
        public string Firstname
        {
            get { return _firstname; }
            set { _firstname = value; }
        }

        [Column(Name = "MiddleName", Required = false)]
        public string Middlename
        {
            get { return _middlename; }
            set { _middlename = value; }
        }

        [Column(Name = "LastName", Required = true)]
        public string Lastname
        {
            get { return _lastname; }
            set { _lastname = value; }
        }

        [Column(Name = "Suffix", Required = false)]
        public string Suffix
        {
            get { return _suffix; }
            set { _suffix = value; }
        }

        [Column(Name = "EmailAddress", Required = false)]
        public string Emailaddress
        {
            get { return _emailaddress; }
            set { _emailaddress = value; }
        }

        [Column(Name = "EmailPromotion", Required = true)]
        public Int32 Emailpromotion
        {
            get { return _emailpromotion; }
            set { _emailpromotion = value; }
        }

        [Column(Name = "Phone", Required = false)]
        public string Phone
        {
            get { return _phone; }
            set { _phone = value; }
        }

        [Column(Name = "PasswordHash", Required = true)]
        public string Passwordhash
        {
            get { return _passwordhash; }
            set { _passwordhash = value; }
        }

        [Column(Name = "PasswordSalt", Required = true)]
        public string Passwordsalt
        {
            get { return _passwordsalt; }
            set { _passwordsalt = value; }
        }

        [Column(Name = "AdditionalContactInfo", Required = false)]
        public string Additionalcontactinfo
        {
            get { return _additionalcontactinfo; }
            set { _additionalcontactinfo = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Contactcreditcard> Contactcreditcards
        {
            get { return _contactcreditcards; }
            set { _contactcreditcards = value; }
        }

        public List<Employee> Employees
        {
            get { return _employees; }
            set { _employees = value; }
        }

        public List<Individual> Individuals
        {
            get { return _individuals; }
            set { _individuals = value; }
        }

        public List<Salesorderheader> Salesorderheaders
        {
            get { return _salesorderheaders; }
            set { _salesorderheaders = value; }
        }

        public List<Storecontact> Storecontacts
        {
            get { return _storecontacts; }
            set { _storecontacts = value; }
        }

        public List<Vendorcontact> Vendorcontacts
        {
            get { return _vendorcontacts; }
            set { _vendorcontacts = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.ContactType")]
    public class Contacttype : MarshalByRefObject
    {
        private Int32 _contacttypeid;
        private string _name;
        private DateTime _modifieddate;
        private List<Storecontact> _storecontacts;
        private List<Vendorcontact> _vendorcontacts;

        [Id(Name = "ContactTypeID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Contacttypeid
        {
            get { return _contacttypeid; }
            set { _contacttypeid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Storecontact> Storecontacts
        {
            get { return _storecontacts; }
            set { _storecontacts = value; }
        }

        public List<Vendorcontact> Vendorcontacts
        {
            get { return _vendorcontacts; }
            set { _vendorcontacts = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.CountryRegion")]
    public class Countryregion : MarshalByRefObject
    {
        private string _countryregioncode;
        private string _name;
        private DateTime _modifieddate;
        private List<Countryregioncurrency> _countryregioncurrencys;
        private List<Stateprovince> _stateprovinces;

        [Id(Name = "CountryRegionCode")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public string Countryregioncode
        {
            get { return _countryregioncode; }
            set { _countryregioncode = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Countryregioncurrency> Countryregioncurrencys
        {
            get { return _countryregioncurrencys; }
            set { _countryregioncurrencys = value; }
        }

        public List<Stateprovince> Stateprovinces
        {
            get { return _stateprovinces; }
            set { _stateprovinces = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Person.StateProvince")]
    public class Stateprovince : MarshalByRefObject
    {
        private Int32 _stateprovinceid;
        private string _stateprovincecode;
        private Countryregion _countryregioncode;
        private bool _isonlystateprovinceflag;
        private string _name;
        private Salesterritory _territoryid;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Address> _addresss;
        private List<Salestaxrate> _salestaxrates;

        [Id(Name = "StateProvinceID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Stateprovinceid
        {
            get { return _stateprovinceid; }
            set { _stateprovinceid = value; }
        }

        [Column(Name = "StateProvinceCode", Required = true)]
        public string Stateprovincecode
        {
            get { return _stateprovincecode; }
            set { _stateprovincecode = value; }
        }

        [Column(Name = "CountryRegionCode", Required = true)]
        public Countryregion Countryregioncode
        {
            get { return _countryregioncode; }
            set { _countryregioncode = value; }
        }

        [Column(Name = "IsOnlyStateProvinceFlag", Required = true)]
        public bool Isonlystateprovinceflag
        {
            get { return _isonlystateprovinceflag; }
            set { _isonlystateprovinceflag = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "TerritoryID", Required = true)]
        public Salesterritory Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Address> Addresss
        {
            get { return _addresss; }
            set { _addresss = value; }
        }

        public List<Salestaxrate> Salestaxrates
        {
            get { return _salestaxrates; }
            set { _salestaxrates = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.BillOfMaterials")]
    public class Billofmaterials : MarshalByRefObject
    {
        private Int32 _billofmaterialsid;
        private Product _productassemblyid;
        private Product _componentid;
        private DateTime _startdate;
        private DateTime? _enddate;
        private Unitmeasure _unitmeasurecode;
        private Int16 _bomlevel;
        private decimal _perassemblyqty;
        private DateTime _modifieddate;

        [Id(Name = "BillOfMaterialsID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Billofmaterialsid
        {
            get { return _billofmaterialsid; }
            set { _billofmaterialsid = value; }
        }

        [Column(Name = "ProductAssemblyID", Required = false)]
        public Product Productassemblyid
        {
            get { return _productassemblyid; }
            set { _productassemblyid = value; }
        }

        [Column(Name = "ComponentID", Required = true)]
        public Product Componentid
        {
            get { return _componentid; }
            set { _componentid = value; }
        }

        [Column(Name = "StartDate", Required = true)]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "UnitMeasureCode", Required = true)]
        public Unitmeasure Unitmeasurecode
        {
            get { return _unitmeasurecode; }
            set { _unitmeasurecode = value; }
        }

        [Column(Name = "BOMLevel", Required = true)]
        public Int16 Bomlevel
        {
            get { return _bomlevel; }
            set { _bomlevel = value; }
        }

        [Column(Name = "PerAssemblyQty", Required = true)]
        public decimal Perassemblyqty
        {
            get { return _perassemblyqty; }
            set { _perassemblyqty = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.Culture")]
    public class Culture : MarshalByRefObject
    {
        private string _cultureid;
        private string _name;
        private DateTime _modifieddate;
        private List<Productmodelproductdescriptionculture> _productmodelproductdescriptioncultures;

        [Id(Name = "CultureID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public string Cultureid
        {
            get { return _cultureid; }
            set { _cultureid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productmodelproductdescriptionculture> Productmodelproductdescriptioncultures
        {
            get { return _productmodelproductdescriptioncultures; }
            set { _productmodelproductdescriptioncultures = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.Document")]
    public class Document : MarshalByRefObject
    {
        private Int32 _documentid;
        private string _title;
        private string _filename;
        private string _fileextension;
        private string _revision;
        private Int32 _changenumber;
        private Int16 _status;
        private string _documentsummary;
        private object _document;
        private DateTime _modifieddate;
        private List<Productdocument> _productdocuments;

        [Id(Name = "DocumentID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Documentid
        {
            get { return _documentid; }
            set { _documentid = value; }
        }

        [Column(Name = "Title", Required = true)]
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        [Column(Name = "FileName", Required = true)]
        public string Filename
        {
            get { return _filename; }
            set { _filename = value; }
        }

        [Column(Name = "FileExtension", Required = true)]
        public string Fileextension
        {
            get { return _fileextension; }
            set { _fileextension = value; }
        }

        [Column(Name = "Revision", Required = true)]
        public string Revision
        {
            get { return _revision; }
            set { _revision = value; }
        }

        [Column(Name = "ChangeNumber", Required = true)]
        public Int32 Changenumber
        {
            get { return _changenumber; }
            set { _changenumber = value; }
        }

        [Column(Name = "Status", Required = true)]
        public Int16 Status
        {
            get { return _status; }
            set { _status = value; }
        }

        [Column(Name = "DocumentSummary", Required = false)]
        public string Documentsummary
        {
            get { return _documentsummary; }
            set { _documentsummary = value; }
        }

        [Column(Name = "Document", Required = false)]
        public object _Document
        {
            get { return _document; }
            set { _document = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productdocument> Productdocuments
        {
            get { return _productdocuments; }
            set { _productdocuments = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.Illustration")]
    public class Illustration : MarshalByRefObject
    {
        private Int32 _illustrationid;
        private string _diagram;
        private DateTime _modifieddate;
        private List<Productmodelillustration> _productmodelillustrations;

        [Id(Name = "IllustrationID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Illustrationid
        {
            get { return _illustrationid; }
            set { _illustrationid = value; }
        }

        [Column(Name = "Diagram", Required = false)]
        public string Diagram
        {
            get { return _diagram; }
            set { _diagram = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productmodelillustration> Productmodelillustrations
        {
            get { return _productmodelillustrations; }
            set { _productmodelillustrations = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.Location")]
    public class Location : MarshalByRefObject
    {
        private Int16 _locationid;
        private string _name;
        private decimal _costrate;
        private decimal _availability;
        private DateTime _modifieddate;
        private List<Productinventory> _productinventorys;
        private List<Workorderrouting> _workorderroutings;

        [Id(Name = "LocationID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int16 Locationid
        {
            get { return _locationid; }
            set { _locationid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "CostRate", Required = true)]
        public decimal Costrate
        {
            get { return _costrate; }
            set { _costrate = value; }
        }

        [Column(Name = "Availability", Required = true)]
        public decimal Availability
        {
            get { return _availability; }
            set { _availability = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productinventory> Productinventorys
        {
            get { return _productinventorys; }
            set { _productinventorys = value; }
        }

        public List<Workorderrouting> Workorderroutings
        {
            get { return _workorderroutings; }
            set { _workorderroutings = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.Product")]
    public class Product : MarshalByRefObject
    {
        private Int32 _productid;
        private string _name;
        private string _productnumber;
        private bool _makeflag;
        private bool _finishedgoodsflag;
        private string _color;
        private Int16 _safetystocklevel;
        private Int16 _reorderpoint;
        private decimal _standardcost;
        private decimal _listprice;
        private string _size;
        private Unitmeasure _sizeunitmeasurecode;
        private Unitmeasure _weightunitmeasurecode;
        private decimal _weight;
        private Int32 _daystomanufacture;
        private string _productline;
        private string _class;
        private string _style;
        private Productsubcategory _productsubcategoryid;
        private Productmodel _productmodelid;
        private DateTime _sellstartdate;
        private DateTime? _sellenddate;
        private DateTime? _discontinueddate;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Billofmaterials> _billofmaterialss;
        private List<Productcosthistory> _productcosthistorys;
        private List<Productdocument> _productdocuments;
        private List<Productinventory> _productinventorys;
        private List<Productlistpricehistory> _productlistpricehistorys;
        private List<Productproductphoto> _productproductphotos;
        private List<Productreview> _productreviews;
        private List<Productvendor> _productvendors;
        private List<Purchaseorderdetail> _purchaseorderdetails;
        private List<Shoppingcartitem> _shoppingcartitems;
        private List<Specialofferproduct> _specialofferproducts;
        private List<Transactionhistory> _transactionhistorys;
        private List<Workorder> _workorders;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ProductNumber", Required = true)]
        public string Productnumber
        {
            get { return _productnumber; }
            set { _productnumber = value; }
        }

        [Column(Name = "MakeFlag", Required = true)]
        public bool Makeflag
        {
            get { return _makeflag; }
            set { _makeflag = value; }
        }

        [Column(Name = "FinishedGoodsFlag", Required = true)]
        public bool Finishedgoodsflag
        {
            get { return _finishedgoodsflag; }
            set { _finishedgoodsflag = value; }
        }

        [Column(Name = "Color", Required = false)]
        public string Color
        {
            get { return _color; }
            set { _color = value; }
        }

        [Column(Name = "SafetyStockLevel", Required = true)]
        public Int16 Safetystocklevel
        {
            get { return _safetystocklevel; }
            set { _safetystocklevel = value; }
        }

        [Column(Name = "ReorderPoint", Required = true)]
        public Int16 Reorderpoint
        {
            get { return _reorderpoint; }
            set { _reorderpoint = value; }
        }

        [Column(Name = "StandardCost", Required = true)]
        public decimal Standardcost
        {
            get { return _standardcost; }
            set { _standardcost = value; }
        }

        [Column(Name = "ListPrice", Required = true)]
        public decimal Listprice
        {
            get { return _listprice; }
            set { _listprice = value; }
        }

        [Column(Name = "Size", Required = false)]
        public string Size
        {
            get { return _size; }
            set { _size = value; }
        }

        [Column(Name = "SizeUnitMeasureCode", Required = false)]
        public Unitmeasure Sizeunitmeasurecode
        {
            get { return _sizeunitmeasurecode; }
            set { _sizeunitmeasurecode = value; }
        }

        [Column(Name = "WeightUnitMeasureCode", Required = false)]
        public Unitmeasure Weightunitmeasurecode
        {
            get { return _weightunitmeasurecode; }
            set { _weightunitmeasurecode = value; }
        }

        [Column(Name = "Weight", Required = false)]
        public decimal Weight
        {
            get { return _weight; }
            set { _weight = value; }
        }

        [Column(Name = "DaysToManufacture", Required = true)]
        public Int32 Daystomanufacture
        {
            get { return _daystomanufacture; }
            set { _daystomanufacture = value; }
        }

        [Column(Name = "ProductLine", Required = false)]
        public string Productline
        {
            get { return _productline; }
            set { _productline = value; }
        }

        [Column(Name = "Class", Required = false)]
        public string Class
        {
            get { return _class; }
            set { _class = value; }
        }

        [Column(Name = "Style", Required = false)]
        public string Style
        {
            get { return _style; }
            set { _style = value; }
        }

        [Column(Name = "ProductSubcategoryID", Required = false)]
        public Productsubcategory Productsubcategoryid
        {
            get { return _productsubcategoryid; }
            set { _productsubcategoryid = value; }
        }

        [Column(Name = "ProductModelID", Required = false)]
        public Productmodel Productmodelid
        {
            get { return _productmodelid; }
            set { _productmodelid = value; }
        }

        [Column(Name = "SellStartDate", Required = true)]
        public DateTime Sellstartdate
        {
            get { return _sellstartdate; }
            set { _sellstartdate = value; }
        }

        [Column(Name = "SellEndDate", Required = false)]
        public DateTime? Sellenddate
        {
            get { return _sellenddate; }
            set { _sellenddate = value; }
        }

        [Column(Name = "DiscontinuedDate", Required = false)]
        public DateTime? Discontinueddate
        {
            get { return _discontinueddate; }
            set { _discontinueddate = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Billofmaterials> Billofmaterialss
        {
            get { return _billofmaterialss; }
            set { _billofmaterialss = value; }
        }

        public List<Productcosthistory> Productcosthistorys
        {
            get { return _productcosthistorys; }
            set { _productcosthistorys = value; }
        }

        public List<Productdocument> Productdocuments
        {
            get { return _productdocuments; }
            set { _productdocuments = value; }
        }

        public List<Productinventory> Productinventorys
        {
            get { return _productinventorys; }
            set { _productinventorys = value; }
        }

        public List<Productlistpricehistory> Productlistpricehistorys
        {
            get { return _productlistpricehistorys; }
            set { _productlistpricehistorys = value; }
        }

        public List<Productproductphoto> Productproductphotos
        {
            get { return _productproductphotos; }
            set { _productproductphotos = value; }
        }

        public List<Productreview> Productreviews
        {
            get { return _productreviews; }
            set { _productreviews = value; }
        }

        public List<Productvendor> Productvendors
        {
            get { return _productvendors; }
            set { _productvendors = value; }
        }

        public List<Purchaseorderdetail> Purchaseorderdetails
        {
            get { return _purchaseorderdetails; }
            set { _purchaseorderdetails = value; }
        }

        public List<Shoppingcartitem> Shoppingcartitems
        {
            get { return _shoppingcartitems; }
            set { _shoppingcartitems = value; }
        }

        public List<Specialofferproduct> Specialofferproducts
        {
            get { return _specialofferproducts; }
            set { _specialofferproducts = value; }
        }

        public List<Transactionhistory> Transactionhistorys
        {
            get { return _transactionhistorys; }
            set { _transactionhistorys = value; }
        }

        public List<Workorder> Workorders
        {
            get { return _workorders; }
            set { _workorders = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductCategory")]
    public class Productcategory : MarshalByRefObject
    {
        private Int32 _productcategoryid;
        private string _name;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Productsubcategory> _productsubcategorys;

        [Id(Name = "ProductCategoryID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productcategoryid
        {
            get { return _productcategoryid; }
            set { _productcategoryid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productsubcategory> Productsubcategorys
        {
            get { return _productsubcategorys; }
            set { _productsubcategorys = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductCostHistory")]
    public class Productcosthistory : MarshalByRefObject
    {
        private Product _productid;
        private DateTime _startdate;
        private DateTime? _enddate;
        private decimal _standardcost;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "StartDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "StandardCost", Required = true)]
        public decimal Standardcost
        {
            get { return _standardcost; }
            set { _standardcost = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductDescription")]
    public class Productdescription : MarshalByRefObject
    {
        private Int32 _productdescriptionid;
        private string _description;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Productmodelproductdescriptionculture> _productmodelproductdescriptioncultures;

        [Id(Name = "ProductDescriptionID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productdescriptionid
        {
            get { return _productdescriptionid; }
            set { _productdescriptionid = value; }
        }

        [Column(Name = "Description", Required = true)]
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productmodelproductdescriptionculture> Productmodelproductdescriptioncultures
        {
            get { return _productmodelproductdescriptioncultures; }
            set { _productmodelproductdescriptioncultures = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductDocument")]
    public class Productdocument : MarshalByRefObject
    {
        private Product _productid;
        private Document _documentid;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "DocumentID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Document Documentid
        {
            get { return _documentid; }
            set { _documentid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductInventory")]
    public class Productinventory : MarshalByRefObject
    {
        private Product _productid;
        private Location _locationid;
        private string _shelf;
        private Int16 _bin;
        private Int16 _quantity;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "LocationID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Location Locationid
        {
            get { return _locationid; }
            set { _locationid = value; }
        }

        [Column(Name = "Shelf", Required = true)]
        public string Shelf
        {
            get { return _shelf; }
            set { _shelf = value; }
        }

        [Column(Name = "Bin", Required = true)]
        public Int16 Bin
        {
            get { return _bin; }
            set { _bin = value; }
        }

        [Column(Name = "Quantity", Required = true)]
        public Int16 Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductListPriceHistory")]
    public class Productlistpricehistory : MarshalByRefObject
    {
        private Product _productid;
        private DateTime _startdate;
        private DateTime? _enddate;
        private decimal _listprice;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "StartDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "ListPrice", Required = true)]
        public decimal Listprice
        {
            get { return _listprice; }
            set { _listprice = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductModel")]
    public class Productmodel : MarshalByRefObject
    {
        private Int32 _productmodelid;
        private string _name;
        private string _catalogdescription;
        private string _instructions;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Productmodelillustration> _productmodelillustrations;
        private List<Productmodelproductdescriptionculture> _productmodelproductdescriptioncultures;

        [Id(Name = "ProductModelID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productmodelid
        {
            get { return _productmodelid; }
            set { _productmodelid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "CatalogDescription", Required = false)]
        public string Catalogdescription
        {
            get { return _catalogdescription; }
            set { _catalogdescription = value; }
        }

        [Column(Name = "Instructions", Required = false)]
        public string Instructions
        {
            get { return _instructions; }
            set { _instructions = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productmodelillustration> Productmodelillustrations
        {
            get { return _productmodelillustrations; }
            set { _productmodelillustrations = value; }
        }

        public List<Productmodelproductdescriptionculture> Productmodelproductdescriptioncultures
        {
            get { return _productmodelproductdescriptioncultures; }
            set { _productmodelproductdescriptioncultures = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductModelIllustration")]
    public class Productmodelillustration : MarshalByRefObject
    {
        private Productmodel _productmodelid;
        private Illustration _illustrationid;
        private DateTime _modifieddate;

        [Id(Name = "ProductModelID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Productmodel Productmodelid
        {
            get { return _productmodelid; }
            set { _productmodelid = value; }
        }

        [Id(Name = "IllustrationID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Illustration Illustrationid
        {
            get { return _illustrationid; }
            set { _illustrationid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductModelProductDescriptionCulture")]
    public class Productmodelproductdescriptionculture : MarshalByRefObject
    {
        private Productmodel _productmodelid;
        private Productdescription _productdescriptionid;
        private Culture _cultureid;
        private DateTime _modifieddate;

        [Id(Name = "ProductModelID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Productmodel Productmodelid
        {
            get { return _productmodelid; }
            set { _productmodelid = value; }
        }

        [Id(Name = "ProductDescriptionID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Productdescription Productdescriptionid
        {
            get { return _productdescriptionid; }
            set { _productdescriptionid = value; }
        }

        [Id(Name = "CultureID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Culture Cultureid
        {
            get { return _cultureid; }
            set { _cultureid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductPhoto")]
    public class Productphoto : MarshalByRefObject
    {
        private Int32 _productphotoid;
        private object _thumbnailphoto;
        private string _thumbnailphotofilename;
        private object _largephoto;
        private string _largephotofilename;
        private DateTime _modifieddate;
        private List<Productproductphoto> _productproductphotos;

        [Id(Name = "ProductPhotoID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productphotoid
        {
            get { return _productphotoid; }
            set { _productphotoid = value; }
        }

        [Column(Name = "ThumbNailPhoto", Required = false)]
        public object Thumbnailphoto
        {
            get { return _thumbnailphoto; }
            set { _thumbnailphoto = value; }
        }

        [Column(Name = "ThumbnailPhotoFileName", Required = false)]
        public string Thumbnailphotofilename
        {
            get { return _thumbnailphotofilename; }
            set { _thumbnailphotofilename = value; }
        }

        [Column(Name = "LargePhoto", Required = false)]
        public object Largephoto
        {
            get { return _largephoto; }
            set { _largephoto = value; }
        }

        [Column(Name = "LargePhotoFileName", Required = false)]
        public string Largephotofilename
        {
            get { return _largephotofilename; }
            set { _largephotofilename = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productproductphoto> Productproductphotos
        {
            get { return _productproductphotos; }
            set { _productproductphotos = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductProductPhoto")]
    public class Productproductphoto : MarshalByRefObject
    {
        private Product _productid;
        private Productphoto _productphotoid;
        private bool _primary;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "ProductPhotoID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Productphoto Productphotoid
        {
            get { return _productphotoid; }
            set { _productphotoid = value; }
        }

        [Column(Name = "Primary", Required = true)]
        public bool Primary
        {
            get { return _primary; }
            set { _primary = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductReview")]
    public class Productreview : MarshalByRefObject
    {
        private Int32 _productreviewid;
        private Product _productid;
        private string _reviewername;
        private DateTime _reviewdate;
        private string _emailaddress;
        private Int32 _rating;
        private string _comments;
        private DateTime _modifieddate;

        [Id(Name = "ProductReviewID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productreviewid
        {
            get { return _productreviewid; }
            set { _productreviewid = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "ReviewerName", Required = true)]
        public string Reviewername
        {
            get { return _reviewername; }
            set { _reviewername = value; }
        }

        [Column(Name = "ReviewDate", Required = true)]
        public DateTime Reviewdate
        {
            get { return _reviewdate; }
            set { _reviewdate = value; }
        }

        [Column(Name = "EmailAddress", Required = true)]
        public string Emailaddress
        {
            get { return _emailaddress; }
            set { _emailaddress = value; }
        }

        [Column(Name = "Rating", Required = true)]
        public Int32 Rating
        {
            get { return _rating; }
            set { _rating = value; }
        }

        [Column(Name = "Comments", Required = false)]
        public string Comments
        {
            get { return _comments; }
            set { _comments = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ProductSubcategory")]
    public class Productsubcategory : MarshalByRefObject
    {
        private Int32 _productsubcategoryid;
        private Productcategory _productcategoryid;
        private string _name;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "ProductSubcategoryID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Productsubcategoryid
        {
            get { return _productsubcategoryid; }
            set { _productsubcategoryid = value; }
        }

        [Column(Name = "ProductCategoryID", Required = true)]
        public Productcategory Productcategoryid
        {
            get { return _productcategoryid; }
            set { _productcategoryid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.ScrapReason")]
    public class Scrapreason : MarshalByRefObject
    {
        private Int16 _scrapreasonid;
        private string _name;
        private DateTime _modifieddate;

        [Id(Name = "ScrapReasonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int16 Scrapreasonid
        {
            get { return _scrapreasonid; }
            set { _scrapreasonid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.TransactionHistory")]
    public class Transactionhistory : MarshalByRefObject
    {
        private Int32 _transactionid;
        private Product _productid;
        private Int32 _referenceorderid;
        private Int32 _referenceorderlineid;
        private DateTime _transactiondate;
        private string _transactiontype;
        private Int32 _quantity;
        private decimal _actualcost;
        private DateTime _modifieddate;

        [Id(Name = "TransactionID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Transactionid
        {
            get { return _transactionid; }
            set { _transactionid = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "ReferenceOrderID", Required = true)]
        public Int32 Referenceorderid
        {
            get { return _referenceorderid; }
            set { _referenceorderid = value; }
        }

        [Column(Name = "ReferenceOrderLineID", Required = true)]
        public Int32 Referenceorderlineid
        {
            get { return _referenceorderlineid; }
            set { _referenceorderlineid = value; }
        }

        [Column(Name = "TransactionDate", Required = true)]
        public DateTime Transactiondate
        {
            get { return _transactiondate; }
            set { _transactiondate = value; }
        }

        [Column(Name = "TransactionType", Required = true)]
        public string Transactiontype
        {
            get { return _transactiontype; }
            set { _transactiontype = value; }
        }

        [Column(Name = "Quantity", Required = true)]
        public Int32 Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        [Column(Name = "ActualCost", Required = true)]
        public decimal Actualcost
        {
            get { return _actualcost; }
            set { _actualcost = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.TransactionHistoryArchive")]
    public class Transactionhistoryarchive : MarshalByRefObject
    {
        private Int32 _transactionid;
        private Int32 _productid;
        private Int32 _referenceorderid;
        private Int32 _referenceorderlineid;
        private DateTime _transactiondate;
        private string _transactiontype;
        private Int32 _quantity;
        private decimal _actualcost;
        private DateTime _modifieddate;

        [Id(Name = "TransactionID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Int32 Transactionid
        {
            get { return _transactionid; }
            set { _transactionid = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Int32 Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "ReferenceOrderID", Required = true)]
        public Int32 Referenceorderid
        {
            get { return _referenceorderid; }
            set { _referenceorderid = value; }
        }

        [Column(Name = "ReferenceOrderLineID", Required = true)]
        public Int32 Referenceorderlineid
        {
            get { return _referenceorderlineid; }
            set { _referenceorderlineid = value; }
        }

        [Column(Name = "TransactionDate", Required = true)]
        public DateTime Transactiondate
        {
            get { return _transactiondate; }
            set { _transactiondate = value; }
        }

        [Column(Name = "TransactionType", Required = true)]
        public string Transactiontype
        {
            get { return _transactiontype; }
            set { _transactiontype = value; }
        }

        [Column(Name = "Quantity", Required = true)]
        public Int32 Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        [Column(Name = "ActualCost", Required = true)]
        public decimal Actualcost
        {
            get { return _actualcost; }
            set { _actualcost = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.UnitMeasure")]
    public class Unitmeasure : MarshalByRefObject
    {
        private string _unitmeasurecode;
        private string _name;
        private DateTime _modifieddate;
        private List<Billofmaterials> _billofmaterialss;
        private List<Productvendor> _productvendors;

        [Id(Name = "UnitMeasureCode")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public string Unitmeasurecode
        {
            get { return _unitmeasurecode; }
            set { _unitmeasurecode = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Billofmaterials> Billofmaterialss
        {
            get { return _billofmaterialss; }
            set { _billofmaterialss = value; }
        }

        public List<Productvendor> Productvendors
        {
            get { return _productvendors; }
            set { _productvendors = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.WorkOrder")]
    public class Workorder : MarshalByRefObject
    {
        private Int32 _workorderid;
        private Product _productid;
        private Int32 _orderqty;
        private Int32 _stockedqty;
        private Int16 _scrappedqty;
        private DateTime _startdate;
        private DateTime? _enddate;
        private DateTime _duedate;
        private Scrapreason _scrapreasonid;
        private DateTime _modifieddate;
        private List<Workorderrouting> _workorderroutings;

        [Id(Name = "WorkOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Workorderid
        {
            get { return _workorderid; }
            set { _workorderid = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "OrderQty", Required = true)]
        public Int32 Orderqty
        {
            get { return _orderqty; }
            set { _orderqty = value; }
        }

        [Column(Name = "StockedQty", Required = true)]
        public Int32 Stockedqty
        {
            get { return _stockedqty; }
            set { _stockedqty = value; }
        }

        [Column(Name = "ScrappedQty", Required = true)]
        public Int16 Scrappedqty
        {
            get { return _scrappedqty; }
            set { _scrappedqty = value; }
        }

        [Column(Name = "StartDate", Required = true)]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "DueDate", Required = true)]
        public DateTime Duedate
        {
            get { return _duedate; }
            set { _duedate = value; }
        }

        [Column(Name = "ScrapReasonID", Required = false)]
        public Scrapreason Scrapreasonid
        {
            get { return _scrapreasonid; }
            set { _scrapreasonid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Workorderrouting> Workorderroutings
        {
            get { return _workorderroutings; }
            set { _workorderroutings = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Production.WorkOrderRouting")]
    public class Workorderrouting : MarshalByRefObject
    {
        private Workorder _workorderid;
        private Int32 _productid;
        private Int16 _operationsequence;
        private Location _locationid;
        private DateTime _scheduledstartdate;
        private DateTime _scheduledenddate;
        private DateTime? _actualstartdate;
        private DateTime? _actualenddate;
        private decimal _actualresourcehrs;
        private decimal _plannedcost;
        private decimal _actualcost;
        private DateTime _modifieddate;

        [Id(Name = "WorkOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Workorder Workorderid
        {
            get { return _workorderid; }
            set { _workorderid = value; }
        }

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Int32 Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "OperationSequence")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Int16 Operationsequence
        {
            get { return _operationsequence; }
            set { _operationsequence = value; }
        }

        [Column(Name = "LocationID", Required = true)]
        public Location Locationid
        {
            get { return _locationid; }
            set { _locationid = value; }
        }

        [Column(Name = "ScheduledStartDate", Required = true)]
        public DateTime Scheduledstartdate
        {
            get { return _scheduledstartdate; }
            set { _scheduledstartdate = value; }
        }

        [Column(Name = "ScheduledEndDate", Required = true)]
        public DateTime Scheduledenddate
        {
            get { return _scheduledenddate; }
            set { _scheduledenddate = value; }
        }

        [Column(Name = "ActualStartDate", Required = false)]
        public DateTime? Actualstartdate
        {
            get { return _actualstartdate; }
            set { _actualstartdate = value; }
        }

        [Column(Name = "ActualEndDate", Required = false)]
        public DateTime? Actualenddate
        {
            get { return _actualenddate; }
            set { _actualenddate = value; }
        }

        [Column(Name = "ActualResourceHrs", Required = false)]
        public decimal Actualresourcehrs
        {
            get { return _actualresourcehrs; }
            set { _actualresourcehrs = value; }
        }

        [Column(Name = "PlannedCost", Required = true)]
        public decimal Plannedcost
        {
            get { return _plannedcost; }
            set { _plannedcost = value; }
        }

        [Column(Name = "ActualCost", Required = false)]
        public decimal Actualcost
        {
            get { return _actualcost; }
            set { _actualcost = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.ProductVendor")]
    public class Productvendor : MarshalByRefObject
    {
        private Product _productid;
        private Vendor _vendorid;
        private Int32 _averageleadtime;
        private decimal _standardprice;
        private decimal _lastreceiptcost;
        private DateTime? _lastreceiptdate;
        private Int32 _minorderqty;
        private Int32 _maxorderqty;
        private Int32? _onorderqty;
        private Unitmeasure _unitmeasurecode;
        private DateTime _modifieddate;

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Id(Name = "VendorID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Vendor Vendorid
        {
            get { return _vendorid; }
            set { _vendorid = value; }
        }

        [Column(Name = "AverageLeadTime", Required = true)]
        public Int32 Averageleadtime
        {
            get { return _averageleadtime; }
            set { _averageleadtime = value; }
        }

        [Column(Name = "StandardPrice", Required = true)]
        public decimal Standardprice
        {
            get { return _standardprice; }
            set { _standardprice = value; }
        }

        [Column(Name = "LastReceiptCost", Required = false)]
        public decimal Lastreceiptcost
        {
            get { return _lastreceiptcost; }
            set { _lastreceiptcost = value; }
        }

        [Column(Name = "LastReceiptDate", Required = false)]
        public DateTime? Lastreceiptdate
        {
            get { return _lastreceiptdate; }
            set { _lastreceiptdate = value; }
        }

        [Column(Name = "MinOrderQty", Required = true)]
        public Int32 Minorderqty
        {
            get { return _minorderqty; }
            set { _minorderqty = value; }
        }

        [Column(Name = "MaxOrderQty", Required = true)]
        public Int32 Maxorderqty
        {
            get { return _maxorderqty; }
            set { _maxorderqty = value; }
        }

        [Column(Name = "OnOrderQty", Required = false)]
        public Int32? Onorderqty
        {
            get { return _onorderqty; }
            set { _onorderqty = value; }
        }

        [Column(Name = "UnitMeasureCode", Required = true)]
        public Unitmeasure Unitmeasurecode
        {
            get { return _unitmeasurecode; }
            set { _unitmeasurecode = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.PurchaseOrderDetail")]
    public class Purchaseorderdetail : MarshalByRefObject
    {
        private Purchaseorderheader _purchaseorderid;
        private Int32 _purchaseorderdetailid;
        private DateTime _duedate;
        private Int16 _orderqty;
        private Product _productid;
        private decimal _unitprice;
        private decimal _linetotal;
        private decimal _receivedqty;
        private decimal _rejectedqty;
        private decimal _stockedqty;
        private DateTime _modifieddate;

        [Id(Name = "PurchaseOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Purchaseorderheader Purchaseorderid
        {
            get { return _purchaseorderid; }
            set { _purchaseorderid = value; }
        }

        [Id(Name = "PurchaseOrderDetailID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Purchaseorderdetailid
        {
            get { return _purchaseorderdetailid; }
            set { _purchaseorderdetailid = value; }
        }

        [Column(Name = "DueDate", Required = true)]
        public DateTime Duedate
        {
            get { return _duedate; }
            set { _duedate = value; }
        }

        [Column(Name = "OrderQty", Required = true)]
        public Int16 Orderqty
        {
            get { return _orderqty; }
            set { _orderqty = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "UnitPrice", Required = true)]
        public decimal Unitprice
        {
            get { return _unitprice; }
            set { _unitprice = value; }
        }

        [Column(Name = "LineTotal", Required = true)]
        public decimal Linetotal
        {
            get { return _linetotal; }
            set { _linetotal = value; }
        }

        [Column(Name = "ReceivedQty", Required = true)]
        public decimal Receivedqty
        {
            get { return _receivedqty; }
            set { _receivedqty = value; }
        }

        [Column(Name = "RejectedQty", Required = true)]
        public decimal Rejectedqty
        {
            get { return _rejectedqty; }
            set { _rejectedqty = value; }
        }

        [Column(Name = "StockedQty", Required = true)]
        public decimal Stockedqty
        {
            get { return _stockedqty; }
            set { _stockedqty = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.PurchaseOrderHeader")]
    public class Purchaseorderheader : MarshalByRefObject
    {
        private Int32 _purchaseorderid;
        private Int16 _revisionnumber;
        private Int16 _status;
        private Employee _employeeid;
        private Vendor _vendorid;
        private Shipmethod _shipmethodid;
        private DateTime _orderdate;
        private DateTime? _shipdate;
        private decimal _subtotal;
        private decimal _taxamt;
        private decimal _freight;
        private decimal _totaldue;
        private DateTime _modifieddate;
        private List<Purchaseorderdetail> _purchaseorderdetails;

        [Id(Name = "PurchaseOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Purchaseorderid
        {
            get { return _purchaseorderid; }
            set { _purchaseorderid = value; }
        }

        [Column(Name = "RevisionNumber", Required = true)]
        public Int16 Revisionnumber
        {
            get { return _revisionnumber; }
            set { _revisionnumber = value; }
        }

        [Column(Name = "Status", Required = true)]
        public Int16 Status
        {
            get { return _status; }
            set { _status = value; }
        }

        [Column(Name = "EmployeeID", Required = true)]
        public Employee Employeeid
        {
            get { return _employeeid; }
            set { _employeeid = value; }
        }

        [Column(Name = "VendorID", Required = true)]
        public Vendor Vendorid
        {
            get { return _vendorid; }
            set { _vendorid = value; }
        }

        [Column(Name = "ShipMethodID", Required = true)]
        public Shipmethod Shipmethodid
        {
            get { return _shipmethodid; }
            set { _shipmethodid = value; }
        }

        [Column(Name = "OrderDate", Required = true)]
        public DateTime Orderdate
        {
            get { return _orderdate; }
            set { _orderdate = value; }
        }

        [Column(Name = "ShipDate", Required = false)]
        public DateTime? Shipdate
        {
            get { return _shipdate; }
            set { _shipdate = value; }
        }

        [Column(Name = "SubTotal", Required = true)]
        public decimal Subtotal
        {
            get { return _subtotal; }
            set { _subtotal = value; }
        }

        [Column(Name = "TaxAmt", Required = true)]
        public decimal Taxamt
        {
            get { return _taxamt; }
            set { _taxamt = value; }
        }

        [Column(Name = "Freight", Required = true)]
        public decimal Freight
        {
            get { return _freight; }
            set { _freight = value; }
        }

        [Column(Name = "TotalDue", Required = true)]
        public decimal Totaldue
        {
            get { return _totaldue; }
            set { _totaldue = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Purchaseorderdetail> Purchaseorderdetails
        {
            get { return _purchaseorderdetails; }
            set { _purchaseorderdetails = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.ShipMethod")]
    public class Shipmethod : MarshalByRefObject
    {
        private Int32 _shipmethodid;
        private string _name;
        private decimal _shipbase;
        private decimal _shiprate;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Purchaseorderheader> _purchaseorderheaders;
        private List<Salesorderheader> _salesorderheaders;

        [Id(Name = "ShipMethodID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Shipmethodid
        {
            get { return _shipmethodid; }
            set { _shipmethodid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ShipBase", Required = true)]
        public decimal Shipbase
        {
            get { return _shipbase; }
            set { _shipbase = value; }
        }

        [Column(Name = "ShipRate", Required = true)]
        public decimal Shiprate
        {
            get { return _shiprate; }
            set { _shiprate = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Purchaseorderheader> Purchaseorderheaders
        {
            get { return _purchaseorderheaders; }
            set { _purchaseorderheaders = value; }
        }

        public List<Salesorderheader> Salesorderheaders
        {
            get { return _salesorderheaders; }
            set { _salesorderheaders = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.Vendor")]
    public class Vendor : MarshalByRefObject
    {
        private Int32 _vendorid;
        private string _accountnumber;
        private string _name;
        private Int16 _creditrating;
        private bool _preferredvendorstatus;
        private bool _activeflag;
        private string _purchasingwebserviceurl;
        private DateTime _modifieddate;
        private List<Productvendor> _productvendors;
        private List<Purchaseorderheader> _purchaseorderheaders;
        private List<Vendoraddress> _vendoraddresss;
        private List<Vendorcontact> _vendorcontacts;

        [Id(Name = "VendorID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Vendorid
        {
            get { return _vendorid; }
            set { _vendorid = value; }
        }

        [Column(Name = "AccountNumber", Required = true)]
        public string Accountnumber
        {
            get { return _accountnumber; }
            set { _accountnumber = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "CreditRating", Required = true)]
        public Int16 Creditrating
        {
            get { return _creditrating; }
            set { _creditrating = value; }
        }

        [Column(Name = "PreferredVendorStatus", Required = true)]
        public bool Preferredvendorstatus
        {
            get { return _preferredvendorstatus; }
            set { _preferredvendorstatus = value; }
        }

        [Column(Name = "ActiveFlag", Required = true)]
        public bool Activeflag
        {
            get { return _activeflag; }
            set { _activeflag = value; }
        }

        [Column(Name = "PurchasingWebServiceURL", Required = false)]
        public string Purchasingwebserviceurl
        {
            get { return _purchasingwebserviceurl; }
            set { _purchasingwebserviceurl = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Productvendor> Productvendors
        {
            get { return _productvendors; }
            set { _productvendors = value; }
        }

        public List<Purchaseorderheader> Purchaseorderheaders
        {
            get { return _purchaseorderheaders; }
            set { _purchaseorderheaders = value; }
        }

        public List<Vendoraddress> Vendoraddresss
        {
            get { return _vendoraddresss; }
            set { _vendoraddresss = value; }
        }

        public List<Vendorcontact> Vendorcontacts
        {
            get { return _vendorcontacts; }
            set { _vendorcontacts = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.VendorAddress")]
    public class Vendoraddress : MarshalByRefObject
    {
        private Vendor _vendorid;
        private Address _addressid;
        private Addresstype _addresstypeid;
        private DateTime _modifieddate;

        [Id(Name = "VendorID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Vendor Vendorid
        {
            get { return _vendorid; }
            set { _vendorid = value; }
        }

        [Id(Name = "AddressID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Address Addressid
        {
            get { return _addressid; }
            set { _addressid = value; }
        }

        [Column(Name = "AddressTypeID", Required = true)]
        public Addresstype Addresstypeid
        {
            get { return _addresstypeid; }
            set { _addresstypeid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Purchasing.VendorContact")]
    public class Vendorcontact : MarshalByRefObject
    {
        private Vendor _vendorid;
        private Contact _contactid;
        private Contacttype _contacttypeid;
        private DateTime _modifieddate;

        [Id(Name = "VendorID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Vendor Vendorid
        {
            get { return _vendorid; }
            set { _vendorid = value; }
        }

        [Id(Name = "ContactID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "ContactTypeID", Required = true)]
        public Contacttype Contacttypeid
        {
            get { return _contacttypeid; }
            set { _contacttypeid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.ContactCreditCard")]
    public class Contactcreditcard : MarshalByRefObject
    {
        private Contact _contactid;
        private Creditcard _creditcardid;
        private DateTime _modifieddate;

        [Id(Name = "ContactID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Id(Name = "CreditCardID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Creditcard Creditcardid
        {
            get { return _creditcardid; }
            set { _creditcardid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.CountryRegionCurrency")]
    public class Countryregioncurrency : MarshalByRefObject
    {
        private Countryregion _countryregioncode;
        private Currency _currencycode;
        private DateTime _modifieddate;

        [Id(Name = "CountryRegionCode")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Countryregion Countryregioncode
        {
            get { return _countryregioncode; }
            set { _countryregioncode = value; }
        }

        [Id(Name = "CurrencyCode")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Currency Currencycode
        {
            get { return _currencycode; }
            set { _currencycode = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.CreditCard")]
    public class Creditcard : MarshalByRefObject
    {
        private Int32 _creditcardid;
        private string _cardtype;
        private string _cardnumber;
        private Int16 _expmonth;
        private Int16 _expyear;
        private DateTime _modifieddate;
        private List<Contactcreditcard> _contactcreditcards;

        [Id(Name = "CreditCardID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Creditcardid
        {
            get { return _creditcardid; }
            set { _creditcardid = value; }
        }

        [Column(Name = "CardType", Required = true)]
        public string Cardtype
        {
            get { return _cardtype; }
            set { _cardtype = value; }
        }

        [Column(Name = "CardNumber", Required = true)]
        public string Cardnumber
        {
            get { return _cardnumber; }
            set { _cardnumber = value; }
        }

        [Column(Name = "ExpMonth", Required = true)]
        public Int16 Expmonth
        {
            get { return _expmonth; }
            set { _expmonth = value; }
        }

        [Column(Name = "ExpYear", Required = true)]
        public Int16 Expyear
        {
            get { return _expyear; }
            set { _expyear = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Contactcreditcard> Contactcreditcards
        {
            get { return _contactcreditcards; }
            set { _contactcreditcards = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.Currency")]
    public class Currency : MarshalByRefObject
    {
        private string _currencycode;
        private string _name;
        private DateTime _modifieddate;
        private List<Countryregioncurrency> _countryregioncurrencys;
        private List<Currencyrate> _currencyrates;

        [Id(Name = "CurrencyCode")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public string Currencycode
        {
            get { return _currencycode; }
            set { _currencycode = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Countryregioncurrency> Countryregioncurrencys
        {
            get { return _countryregioncurrencys; }
            set { _countryregioncurrencys = value; }
        }

        public List<Currencyrate> Currencyrates
        {
            get { return _currencyrates; }
            set { _currencyrates = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.CurrencyRate")]
    public class Currencyrate : MarshalByRefObject
    {
        private Int32 _currencyrateid;
        private DateTime _currencyratedate;
        private Currency _fromcurrencycode;
        private Currency _tocurrencycode;
        private decimal _averagerate;
        private decimal _endofdayrate;
        private DateTime _modifieddate;

        [Id(Name = "CurrencyRateID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Currencyrateid
        {
            get { return _currencyrateid; }
            set { _currencyrateid = value; }
        }

        [Column(Name = "CurrencyRateDate", Required = true)]
        public DateTime Currencyratedate
        {
            get { return _currencyratedate; }
            set { _currencyratedate = value; }
        }

        [Column(Name = "FromCurrencyCode", Required = true)]
        public Currency Fromcurrencycode
        {
            get { return _fromcurrencycode; }
            set { _fromcurrencycode = value; }
        }

        [Column(Name = "ToCurrencyCode", Required = true)]
        public Currency Tocurrencycode
        {
            get { return _tocurrencycode; }
            set { _tocurrencycode = value; }
        }

        [Column(Name = "AverageRate", Required = true)]
        public decimal Averagerate
        {
            get { return _averagerate; }
            set { _averagerate = value; }
        }

        [Column(Name = "EndOfDayRate", Required = true)]
        public decimal Endofdayrate
        {
            get { return _endofdayrate; }
            set { _endofdayrate = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.Customer")]
    public class Customer : MarshalByRefObject
    {
        private Int32 _customerid;
        private Salesterritory _territoryid;
        private string _accountnumber;
        private string _customertype;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Customeraddress> _customeraddresss;
        private List<Individual> _individuals;
        private List<Salesorderheader> _salesorderheaders;
        private List<Store> _stores;

        [Id(Name = "CustomerID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Column(Name = "TerritoryID", Required = false)]
        public Salesterritory Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Column(Name = "AccountNumber", Required = true)]
        public string Accountnumber
        {
            get { return _accountnumber; }
            set { _accountnumber = value; }
        }

        [Column(Name = "CustomerType", Required = true)]
        public string Customertype
        {
            get { return _customertype; }
            set { _customertype = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Customeraddress> Customeraddresss
        {
            get { return _customeraddresss; }
            set { _customeraddresss = value; }
        }

        public List<Individual> Individuals
        {
            get { return _individuals; }
            set { _individuals = value; }
        }

        public List<Salesorderheader> Salesorderheaders
        {
            get { return _salesorderheaders; }
            set { _salesorderheaders = value; }
        }

        public List<Store> Stores
        {
            get { return _stores; }
            set { _stores = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.CustomerAddress")]
    public class Customeraddress : MarshalByRefObject
    {
        private Customer _customerid;
        private Address _addressid;
        private Addresstype _addresstypeid;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "CustomerID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Customer Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Id(Name = "AddressID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Address Addressid
        {
            get { return _addressid; }
            set { _addressid = value; }
        }

        [Column(Name = "AddressTypeID", Required = true)]
        public Addresstype Addresstypeid
        {
            get { return _addresstypeid; }
            set { _addresstypeid = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.Individual")]
    public class Individual : MarshalByRefObject
    {
        private Customer _customerid;
        private Contact _contactid;
        private string _demographics;
        private DateTime _modifieddate;

        [Id(Name = "CustomerID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Customer Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Column(Name = "ContactID", Required = true)]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "Demographics", Required = false)]
        public string Demographics
        {
            get { return _demographics; }
            set { _demographics = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesOrderDetail")]
    public class Salesorderdetail : MarshalByRefObject
    {
        private Salesorderheader _salesorderid;
        private Int32 _salesorderdetailid;
        private string _carriertrackingnumber;
        private Int16 _orderqty;
        private Specialofferproduct _productid;
        private Specialofferproduct _specialofferid;
        private decimal _unitprice;
        private decimal _unitpricediscount;
        private decimal _linetotal;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "SalesOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesorderheader Salesorderid
        {
            get { return _salesorderid; }
            set { _salesorderid = value; }
        }

        [Id(Name = "SalesOrderDetailID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Salesorderdetailid
        {
            get { return _salesorderdetailid; }
            set { _salesorderdetailid = value; }
        }

        [Column(Name = "CarrierTrackingNumber", Required = false)]
        public string Carriertrackingnumber
        {
            get { return _carriertrackingnumber; }
            set { _carriertrackingnumber = value; }
        }

        [Column(Name = "OrderQty", Required = true)]
        public Int16 Orderqty
        {
            get { return _orderqty; }
            set { _orderqty = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Specialofferproduct Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "SpecialOfferID", Required = true)]
        public Specialofferproduct Specialofferid
        {
            get { return _specialofferid; }
            set { _specialofferid = value; }
        }

        [Column(Name = "UnitPrice", Required = true)]
        public decimal Unitprice
        {
            get { return _unitprice; }
            set { _unitprice = value; }
        }

        [Column(Name = "UnitPriceDiscount", Required = true)]
        public decimal Unitpricediscount
        {
            get { return _unitpricediscount; }
            set { _unitpricediscount = value; }
        }

        [Column(Name = "LineTotal", Required = true)]
        public decimal Linetotal
        {
            get { return _linetotal; }
            set { _linetotal = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesOrderHeader")]
    public class Salesorderheader : MarshalByRefObject
    {
        private Int32 _salesorderid;
        private Int16 _revisionnumber;
        private DateTime _orderdate;
        private DateTime _duedate;
        private DateTime? _shipdate;
        private Int16 _status;
        private bool _onlineorderflag;
        private string _salesordernumber;
        private string _purchaseordernumber;
        private string _accountnumber;
        private Customer _customerid;
        private Contact _contactid;
        private Salesperson _salespersonid;
        private Salesterritory _territoryid;
        private Address _billtoaddressid;
        private Address _shiptoaddressid;
        private Shipmethod _shipmethodid;
        private Creditcard _creditcardid;
        private string _creditcardapprovalcode;
        private Currencyrate _currencyrateid;
        private decimal _subtotal;
        private decimal _taxamt;
        private decimal _freight;
        private decimal _totaldue;
        private string _comment;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Salesorderdetail> _salesorderdetails;
        private List<Salesorderheadersalesreason> _salesorderheadersalesreasons;

        [Id(Name = "SalesOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Salesorderid
        {
            get { return _salesorderid; }
            set { _salesorderid = value; }
        }

        [Column(Name = "RevisionNumber", Required = true)]
        public Int16 Revisionnumber
        {
            get { return _revisionnumber; }
            set { _revisionnumber = value; }
        }

        [Column(Name = "OrderDate", Required = true)]
        public DateTime Orderdate
        {
            get { return _orderdate; }
            set { _orderdate = value; }
        }

        [Column(Name = "DueDate", Required = true)]
        public DateTime Duedate
        {
            get { return _duedate; }
            set { _duedate = value; }
        }

        [Column(Name = "ShipDate", Required = false)]
        public DateTime? Shipdate
        {
            get { return _shipdate; }
            set { _shipdate = value; }
        }

        [Column(Name = "Status", Required = true)]
        public Int16 Status
        {
            get { return _status; }
            set { _status = value; }
        }

        [Column(Name = "OnlineOrderFlag", Required = true)]
        public bool Onlineorderflag
        {
            get { return _onlineorderflag; }
            set { _onlineorderflag = value; }
        }

        [Column(Name = "SalesOrderNumber", Required = true)]
        public string Salesordernumber
        {
            get { return _salesordernumber; }
            set { _salesordernumber = value; }
        }

        [Column(Name = "PurchaseOrderNumber", Required = false)]
        public string Purchaseordernumber
        {
            get { return _purchaseordernumber; }
            set { _purchaseordernumber = value; }
        }

        [Column(Name = "AccountNumber", Required = false)]
        public string Accountnumber
        {
            get { return _accountnumber; }
            set { _accountnumber = value; }
        }

        [Column(Name = "CustomerID", Required = true)]
        public Customer Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Column(Name = "ContactID", Required = true)]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "SalesPersonID", Required = false)]
        public Salesperson Salespersonid
        {
            get { return _salespersonid; }
            set { _salespersonid = value; }
        }

        [Column(Name = "TerritoryID", Required = false)]
        public Salesterritory Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Column(Name = "BillToAddressID", Required = true)]
        public Address Billtoaddressid
        {
            get { return _billtoaddressid; }
            set { _billtoaddressid = value; }
        }

        [Column(Name = "ShipToAddressID", Required = true)]
        public Address Shiptoaddressid
        {
            get { return _shiptoaddressid; }
            set { _shiptoaddressid = value; }
        }

        [Column(Name = "ShipMethodID", Required = true)]
        public Shipmethod Shipmethodid
        {
            get { return _shipmethodid; }
            set { _shipmethodid = value; }
        }

        [Column(Name = "CreditCardID", Required = false)]
        public Creditcard Creditcardid
        {
            get { return _creditcardid; }
            set { _creditcardid = value; }
        }

        [Column(Name = "CreditCardApprovalCode", Required = false)]
        public string Creditcardapprovalcode
        {
            get { return _creditcardapprovalcode; }
            set { _creditcardapprovalcode = value; }
        }

        [Column(Name = "CurrencyRateID", Required = false)]
        public Currencyrate Currencyrateid
        {
            get { return _currencyrateid; }
            set { _currencyrateid = value; }
        }

        [Column(Name = "SubTotal", Required = true)]
        public decimal Subtotal
        {
            get { return _subtotal; }
            set { _subtotal = value; }
        }

        [Column(Name = "TaxAmt", Required = true)]
        public decimal Taxamt
        {
            get { return _taxamt; }
            set { _taxamt = value; }
        }

        [Column(Name = "Freight", Required = true)]
        public decimal Freight
        {
            get { return _freight; }
            set { _freight = value; }
        }

        [Column(Name = "TotalDue", Required = true)]
        public decimal Totaldue
        {
            get { return _totaldue; }
            set { _totaldue = value; }
        }

        [Column(Name = "Comment", Required = false)]
        public string Comment
        {
            get { return _comment; }
            set { _comment = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Salesorderdetail> Salesorderdetails
        {
            get { return _salesorderdetails; }
            set { _salesorderdetails = value; }
        }

        public List<Salesorderheadersalesreason> Salesorderheadersalesreasons
        {
            get { return _salesorderheadersalesreasons; }
            set { _salesorderheadersalesreasons = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesOrderHeaderSalesReason")]
    public class Salesorderheadersalesreason : MarshalByRefObject
    {
        private Salesorderheader _salesorderid;
        private Salesreason _salesreasonid;
        private DateTime _modifieddate;

        [Id(Name = "SalesOrderID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesorderheader Salesorderid
        {
            get { return _salesorderid; }
            set { _salesorderid = value; }
        }

        [Id(Name = "SalesReasonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesreason Salesreasonid
        {
            get { return _salesreasonid; }
            set { _salesreasonid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesPerson")]
    public class Salesperson : MarshalByRefObject
    {
        private Employee _salespersonid;
        private Salesterritory _territoryid;
        private decimal _salesquota;
        private decimal _bonus;
        private decimal _commissionpct;
        private decimal _salesytd;
        private decimal _saleslastyear;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Salespersonquotahistory> _salespersonquotahistorys;
        private List<Salesterritoryhistory> _salesterritoryhistorys;

        [Id(Name = "SalesPersonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Employee Salespersonid
        {
            get { return _salespersonid; }
            set { _salespersonid = value; }
        }

        [Column(Name = "TerritoryID", Required = false)]
        public Salesterritory Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Column(Name = "SalesQuota", Required = false)]
        public decimal Salesquota
        {
            get { return _salesquota; }
            set { _salesquota = value; }
        }

        [Column(Name = "Bonus", Required = true)]
        public decimal Bonus
        {
            get { return _bonus; }
            set { _bonus = value; }
        }

        [Column(Name = "CommissionPct", Required = true)]
        public decimal Commissionpct
        {
            get { return _commissionpct; }
            set { _commissionpct = value; }
        }

        [Column(Name = "SalesYTD", Required = true)]
        public decimal Salesytd
        {
            get { return _salesytd; }
            set { _salesytd = value; }
        }

        [Column(Name = "SalesLastYear", Required = true)]
        public decimal Saleslastyear
        {
            get { return _saleslastyear; }
            set { _saleslastyear = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Salespersonquotahistory> Salespersonquotahistorys
        {
            get { return _salespersonquotahistorys; }
            set { _salespersonquotahistorys = value; }
        }

        public List<Salesterritoryhistory> Salesterritoryhistorys
        {
            get { return _salesterritoryhistorys; }
            set { _salesterritoryhistorys = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesPersonQuotaHistory")]
    public class Salespersonquotahistory : MarshalByRefObject
    {
        private Salesperson _salespersonid;
        private DateTime _quotadate;
        private decimal _salesquota;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "SalesPersonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesperson Salespersonid
        {
            get { return _salespersonid; }
            set { _salespersonid = value; }
        }

        [Id(Name = "QuotaDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Quotadate
        {
            get { return _quotadate; }
            set { _quotadate = value; }
        }

        [Column(Name = "SalesQuota", Required = true)]
        public decimal Salesquota
        {
            get { return _salesquota; }
            set { _salesquota = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesReason")]
    public class Salesreason : MarshalByRefObject
    {
        private Int32 _salesreasonid;
        private string _name;
        private string _reasontype;
        private DateTime _modifieddate;
        private List<Salesorderheadersalesreason> _salesorderheadersalesreasons;

        [Id(Name = "SalesReasonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Salesreasonid
        {
            get { return _salesreasonid; }
            set { _salesreasonid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "ReasonType", Required = true)]
        public string Reasontype
        {
            get { return _reasontype; }
            set { _reasontype = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Salesorderheadersalesreason> Salesorderheadersalesreasons
        {
            get { return _salesorderheadersalesreasons; }
            set { _salesorderheadersalesreasons = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesTaxRate")]
    public class Salestaxrate : MarshalByRefObject
    {
        private Int32 _salestaxrateid;
        private Stateprovince _stateprovinceid;
        private Int16 _taxtype;
        private decimal _taxrate;
        private string _name;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "SalesTaxRateID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Salestaxrateid
        {
            get { return _salestaxrateid; }
            set { _salestaxrateid = value; }
        }

        [Column(Name = "StateProvinceID", Required = true)]
        public Stateprovince Stateprovinceid
        {
            get { return _stateprovinceid; }
            set { _stateprovinceid = value; }
        }

        [Column(Name = "TaxType", Required = true)]
        public Int16 Taxtype
        {
            get { return _taxtype; }
            set { _taxtype = value; }
        }

        [Column(Name = "TaxRate", Required = true)]
        public decimal Taxrate
        {
            get { return _taxrate; }
            set { _taxrate = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesTerritory")]
    public class Salesterritory : MarshalByRefObject
    {
        private Int32 _territoryid;
        private string _name;
        private string _countryregioncode;
        private string _group;
        private decimal _salesytd;
        private decimal _saleslastyear;
        private decimal _costytd;
        private decimal _costlastyear;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Salesterritoryhistory> _salesterritoryhistorys;
        private List<Stateprovince> _stateprovinces;

        [Id(Name = "TerritoryID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "CountryRegionCode", Required = true)]
        public string Countryregioncode
        {
            get { return _countryregioncode; }
            set { _countryregioncode = value; }
        }

        [Column(Name = "Group", Required = true)]
        public string Group
        {
            get { return _group; }
            set { _group = value; }
        }

        [Column(Name = "SalesYTD", Required = true)]
        public decimal Salesytd
        {
            get { return _salesytd; }
            set { _salesytd = value; }
        }

        [Column(Name = "SalesLastYear", Required = true)]
        public decimal Saleslastyear
        {
            get { return _saleslastyear; }
            set { _saleslastyear = value; }
        }

        [Column(Name = "CostYTD", Required = true)]
        public decimal Costytd
        {
            get { return _costytd; }
            set { _costytd = value; }
        }

        [Column(Name = "CostLastYear", Required = true)]
        public decimal Costlastyear
        {
            get { return _costlastyear; }
            set { _costlastyear = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Salesterritoryhistory> Salesterritoryhistorys
        {
            get { return _salesterritoryhistorys; }
            set { _salesterritoryhistorys = value; }
        }

        public List<Stateprovince> Stateprovinces
        {
            get { return _stateprovinces; }
            set { _stateprovinces = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SalesTerritoryHistory")]
    public class Salesterritoryhistory : MarshalByRefObject
    {
        private Salesperson _salespersonid;
        private Salesterritory _territoryid;
        private DateTime _startdate;
        private DateTime? _enddate;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "SalesPersonID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesperson Salespersonid
        {
            get { return _salespersonid; }
            set { _salespersonid = value; }
        }

        [Id(Name = "TerritoryID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Salesterritory Territoryid
        {
            get { return _territoryid; }
            set { _territoryid = value; }
        }

        [Id(Name = "StartDate")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = false)]
        public DateTime? Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.ShoppingCartItem")]
    public class Shoppingcartitem : MarshalByRefObject
    {
        private Int32 _shoppingcartitemid;
        private string _shoppingcartid;
        private Int32 _quantity;
        private Product _productid;
        private DateTime _datecreated;
        private DateTime _modifieddate;

        [Id(Name = "ShoppingCartItemID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Shoppingcartitemid
        {
            get { return _shoppingcartitemid; }
            set { _shoppingcartitemid = value; }
        }

        [Column(Name = "ShoppingCartID", Required = true)]
        public string Shoppingcartid
        {
            get { return _shoppingcartid; }
            set { _shoppingcartid = value; }
        }

        [Column(Name = "Quantity", Required = true)]
        public Int32 Quantity
        {
            get { return _quantity; }
            set { _quantity = value; }
        }

        [Column(Name = "ProductID", Required = true)]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "DateCreated", Required = true)]
        public DateTime Datecreated
        {
            get { return _datecreated; }
            set { _datecreated = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SpecialOffer")]
    public class Specialoffer : MarshalByRefObject
    {
        private Int32 _specialofferid;
        private string _description;
        private decimal _discountpct;
        private string _type;
        private string _category;
        private DateTime _startdate;
        private DateTime _enddate;
        private Int32 _minqty;
        private Int32? _maxqty;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Specialofferproduct> _specialofferproducts;

        [Id(Name = "SpecialOfferID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Native)]
        public Int32 Specialofferid
        {
            get { return _specialofferid; }
            set { _specialofferid = value; }
        }

        [Column(Name = "Description", Required = true)]
        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }

        [Column(Name = "DiscountPct", Required = true)]
        public decimal Discountpct
        {
            get { return _discountpct; }
            set { _discountpct = value; }
        }

        [Column(Name = "Type", Required = true)]
        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        [Column(Name = "Category", Required = true)]
        public string Category
        {
            get { return _category; }
            set { _category = value; }
        }

        [Column(Name = "StartDate", Required = true)]
        public DateTime Startdate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }

        [Column(Name = "EndDate", Required = true)]
        public DateTime Enddate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }

        [Column(Name = "MinQty", Required = true)]
        public Int32 Minqty
        {
            get { return _minqty; }
            set { _minqty = value; }
        }

        [Column(Name = "MaxQty", Required = false)]
        public Int32? Maxqty
        {
            get { return _maxqty; }
            set { _maxqty = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Specialofferproduct> Specialofferproducts
        {
            get { return _specialofferproducts; }
            set { _specialofferproducts = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.SpecialOfferProduct")]
    public class Specialofferproduct : MarshalByRefObject
    {
        private Specialoffer _specialofferid;
        private Product _productid;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Salesorderdetail> _salesorderdetails;

        [Id(Name = "SpecialOfferID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Specialoffer Specialofferid
        {
            get { return _specialofferid; }
            set { _specialofferid = value; }
        }

        [Id(Name = "ProductID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Product Productid
        {
            get { return _productid; }
            set { _productid = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Salesorderdetail> Salesorderdetails
        {
            get { return _salesorderdetails; }
            set { _salesorderdetails = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.Store")]
    public class Store : MarshalByRefObject
    {
        private Customer _customerid;
        private string _name;
        private Salesperson _salespersonid;
        private string _demographics;
        private object _rowguid;
        private DateTime _modifieddate;
        private List<Storecontact> _storecontacts;

        [Id(Name = "CustomerID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Customer Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Column(Name = "Name", Required = true)]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [Column(Name = "SalesPersonID", Required = false)]
        public Salesperson Salespersonid
        {
            get { return _salespersonid; }
            set { _salespersonid = value; }
        }

        [Column(Name = "Demographics", Required = false)]
        public string Demographics
        {
            get { return _demographics; }
            set { _demographics = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

        public List<Storecontact> Storecontacts
        {
            get { return _storecontacts; }
            set { _storecontacts = value; }
        }

    }
    [Serializable]
    [Table(TableName = "Sales.StoreContact")]
    public class Storecontact : MarshalByRefObject
    {
        private Store _customerid;
        private Contact _contactid;
        private Contacttype _contacttypeid;
        private object _rowguid;
        private DateTime _modifieddate;

        [Id(Name = "CustomerID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Store Customerid
        {
            get { return _customerid; }
            set { _customerid = value; }
        }

        [Id(Name = "ContactID")]
        [AutoNumber(Strategy = AutoNumberStrategy.Sequence
            , SequenceTableName = "sequence"
            , SequenceDescription = "name"
            , SequenceId = "id")]
        public Contact Contactid
        {
            get { return _contactid; }
            set { _contactid = value; }
        }

        [Column(Name = "ContactTypeID", Required = true)]
        public Contacttype Contacttypeid
        {
            get { return _contacttypeid; }
            set { _contacttypeid = value; }
        }

        [Column(Name = "rowguid", Required = true)]
        public object Rowguid
        {
            get { return _rowguid; }
            set { _rowguid = value; }
        }

        [Column(Name = "ModifiedDate", Required = true)]
        public DateTime Modifieddate
        {
            get { return _modifieddate; }
            set { _modifieddate = value; }
        }

    }
}
